Address redundant errors for missing crate for nested imports and later uses of crate#153956
Address redundant errors for missing crate for nested imports and later uses of crate#153956yuk1ty wants to merge 2 commits into
Conversation
|
rustbot has assigned @dingxiangfei2009. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
ac89d2b to
594e22e
Compare
This comment has been minimized.
This comment has been minimized.
594e22e to
4b6cc82
Compare
This comment has been minimized.
This comment has been minimized.
4b6cc82 to
6671a98
Compare
This comment has been minimized.
This comment has been minimized.
6671a98 to
ea4f0fd
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
Track first segments of failed imports and skip late resolution errors for paths sharing the same prefix. This avoids redundant E0433 after an E0432 has already been reported for the same missing module, without suppressing unrelated diagnostics.
ea4f0fd to
343fb27
Compare
|
☔ The latest upstream changes (presumably #155890) made this pull request unmergeable. Please resolve the merge conflicts. |
|
|
||
| mod B { | ||
| use A::{::Fish}; //~ ERROR the crate root in paths can only be used in start position | ||
| use A::{::Fish}; //~ ERROR unresolved import `A::Fish` |
There was a problem hiding this comment.
Hello. This is an unwanted regression in diagnostics, isn't it? In case you haven't looked through all diagnostic output changes and made sure they are all sensible, please do that. Thanks!
|
Reminder, once the PR becomes ready for a review, use |
| #![allow(unused_imports)] | ||
|
|
||
| mod foo {} | ||
|
|
There was a problem hiding this comment.
This is changing the purpose of the test. Please prefer creating another one.
| /// First segments of import paths that failed to resolve. | ||
| /// Used to suppress redundant resolution errors in late resolver | ||
| /// for paths sharing the same unresolved prefix. | ||
| failed_import_prefixes: FxHashSet<Symbol>, |
There was a problem hiding this comment.
This may be sufficient for a single-file test case. What if the prefix exists in one file and not another one?
Fixes #153156
Basically I merged redundant E0433 errors into E0432. The change seems to affect other related tests.
The first commit handles the nested import case. The second commit handles to suppress
foo::qux()pattern.